<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Vancouver Tongue</title>
<link href="/VancouverTongue/static/style.css" type="text/css"
	rel="stylesheet" />
<link rel="shortcut icon" href="/VancouverTongue/static/icon.png" >
<style>
textarea {
	min-height: 200px;
	max-height: 200px;
	min-width: 400px;
	max-width: 400px;
}
</style>
<script>
	function checkTextareLenght() {
		var limit = 500;
		var area = document.getElementById('limitInput');
		var l = area.value.length;
		if (l > limit) {
			area.value = area.value.substr(0, limit);
			l = limit;
		}
		document.getElementById('limitCount').innerHTML = l + '/'+limit;
	}
</script>
</head>
<body>
	<jsp:include page="headTemplate.jsp" />

	<form
		action="/VancouverTongue/restaurant/${restaurant.restaurantId}/addRequest"
		method="post">
		<input type="hidden" name="restaurantId"
			value="${restaurant.restaurantId}" /> <input type="hidden"
			name="actId" value="2" />
		<dl>
			<dt>
				${restaurantName} <label>Restaurant Name: *</label>
			</dt>
			<dd>
				<input type="text" name="restaurantName"
					value="${restaurant.restaurantName}" />
			</dd>
			<dt>
				${streetName} <label>Street: *</label>
			</dt>
			<dd>
				<input type="text" name="streetName"
					value="${restaurant.streetName}" />
			</dd>
			<dt>
				${city} <label>City: *</label>
			</dt>
			<dd>
				<input type="text" name="city" value="${restaurant.city}" />
			</dd>
			<dt>
				${phone} <label>Phone Number: *</label>
			</dt>
			<dd>
				<input type="text" name="phone" value="${restaurant.phone}" />
			</dd>
			<dt>
				<label>Category: </label>
			</dt>
			<dd>
				<select name="categoryCode">
					<c:forEach var="cat" items="${CatList}">
						<option value="${cat.categoryCode}">${cat.name}</option>
					</c:forEach>
				</select>
				<p>${catTest}</p>
			</dd>

			<dt>
				${businessHour} <label>Opening Hours: *</label>

			</dt>
			<dd>
				<input type="text" name="businessHour"
					value="${restaurant.businessHour}" maxlength="100"/>
			</dd>

			<dt>
				${image} <label>Image: </label>
			</dt>
			<dd>
				<input type="text" name="image" value="${restaurant.image}" />
			</dd>
			<dt>
				${website} <label>Website: </label>
			</dt>
			<dd>
				<input type="text" name="website" value="${restaurant.website}" />
			</dd>

			<dt>
				${description} <label>Description: *</label>
			</dt>
			<dd>
				<textarea name="description" onkeyup="checkTextareLenght();"
					id="limitInput">${restaurant.description}</textarea>
				<div id="limitCount"></div>

			</dd>

		</dl>
		<input type="submit" value="Edit" />
	</form>






</body>
</html>